import java.util.Random;

public class Demo04{

	public static void main(String[] args) {
		Random ran = new Random();
		int abc [] = new int [6]; 
		for (int i = 0; i < abc.length; i++) {
			abc [i]=ran.nextInt(100)+1;
		}
		NUM2(abc);
		System.out.println();
		NUM2(NUM1(abc));
		

	}
	public static int[] NUM1(int[]abc){
		for (int i = 0; i < abc.length-1; i++) {
			for (int j = 0; j < abc.length-i-1; j++) {
				if (abc[j]<abc[j+1]) {
					int temp;
					temp=abc[j+1];
					abc[j+1]=abc[j];
					abc[j]=temp;
					
					
					
				}
				
			}
		}
		
		return abc;
	}
	
	
	public static void NUM2(int []num) {
		for (int i = 0; i < num.length; i++) {
			if (i==num.length-1) {
				System.out.print(num[i]);
			}else {
				System.out.print(num[i]+",");
				
			}
			

		}
		
		
	}

}